home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / gem / l_1199 / 1162 < prev    next >
Internet Message Format  |  1994-08-27  |  14KB

  1. Date: Sat, 30 Jul 1994 16:52:42 -0400 (EDT)
  2. From: Timothy Miller <millert@cs.csee.usf.edu>
  3. Subject: Re: Digest
  4. To: gem-list@world.std.com
  5. In-Reply-To: <2e38ffb6fbd12@elfhaven.ersys.edmonton.ab.ca>
  6. Message-Id: <Pine.3.87.9407301642.A26054-0100000@grad>
  7. Mime-Version: 1.0
  8. Precedence: bulk
  9.  
  10. Evan:
  11.  
  12. ]Its a bug in the AES.  I get it too.  Sometimes, I just get clicks with
  13. ]background windows instead of a top.  I get it in TOSWIN alot, which is
  14. ]when I have lots of windows open, so that could be part of it.  I just
  15. ]jam the mouse into the menu bar and then click (since I usually have
  16. ]window everywhere, and the menu bar is the only place uncovered!)
  17.  
  18. If my guess is correct, then it is not a bug in AES.  Rather, 
  19. graf_dragbox and form_button use evnt_multi!  And since evnt_multi 
  20. obviously will not send repeated WM_TOPPED messages to the same window 
  21. while the mouse is held down, then graf_dragbox and form_button will not 
  22. work.  graf_mkstate, on the other hand, works just great.
  23.  
  24. ]Your solution .. you said you were simulating mouse events.  How did
  25. ]you do this.  I wanna see how much it changes the code I posted previously.
  26. ]Since the code I posted allowed some pretty radical behavior (the use
  27. ]of the other mouse buttons during a drag!) and I don't want to lose
  28. ]that flexibility.  In fact, I don't want to call any graf_ functions
  29. ]or anything else that creates a mode.  I want to flow everything though
  30. ]evnt_multi() with an optimized binding (no stack usage, etc) and doll
  31. ]out the events to other objects from there.
  32.  
  33. My solution was to write my own form_button which does nothing 
  34. spectacular.  It just does everything that the normal form_button (took 
  35. me a lot of guess work, but I can't tell any difference between mine and 
  36. the normal one), except that mine will work even if the object is 
  37. partially obscured.
  38.  
  39. Writing my own form_button solved the problem of it locking up.  The 
  40. second problem was to get repeated mouse events to a background window.  
  41. Since evnt_multi win't sent repeated WM_TOPPED messages, I have to handle 
  42. everything after I get the first one, *plus I have to make sure the mouse 
  43. button it up before the next evnt_multi call*.
  44.  
  45. I have one routine that handles WM_TOPPED events, and another that 
  46. handles MU_BUTTON events.  When I get a WM_TOPPED message for a 
  47. background window that is 'backactive', I get the current mouse position 
  48. and other information and send it to my routine that handles the 
  49. MU_BUTTON events, thereby simulating a button event on the background window.
  50.  
  51. To do drags and to make sure that the button is up before the next 
  52. evnt_multi (when my WM_TOPPED handling routine returns to the caller), I 
  53. have a loop in my WM_TOPPED handler that keeps getting mouse positions 
  54. and information as long as the button is held down.  As soon as the 
  55. button is let up, it returns to the calling routine.
  56.  
  57. This works great.  The only problem is that while the button is down, the 
  58. operations of my library are trapped within itself, not getting back to 
  59. evnt_multi.  But since you can't use evnt_multi anyway, there's no point 
  60. in arguing about it.  However, since my library doesn't use wind_update 
  61. (since it's not using VDI, it doesn't need to, plus a developer is 
  62. responsible for doing it for his own window drawing, PLUS since you're 
  63. dragging around in a window, you couldn't move the mouse pointer to the 
  64. menu bar to fowl anything up), no activities in other windows would be 
  65. bothered with much.
  66.  
  67.  
  68. ]========================================================================
  69. ]Well, I break my library down into a few seperate .C files and the
  70. ]programmer can pick which ones he wants.  I'm sure that's what most of 
  71. us do.
  72. ]========================================================================
  73. ]
  74. ]Nope, you put EVERY function in a separate C file, roll the whole thing
  75. ]into a .a or .lib or what have you, and then whatever functions the
  76. ]programmer uses will be included by the linker.  The linker includes
  77. ]entire .o files, so the programmer doesn't choose, the LINKER chooses.
  78. ]This requires libraries to have TONS of files.  Makes a MINIX filesystem
  79. ]very handy, but that is beside the point.
  80.  
  81. Sounds icky, but I'll see what I can do.  I think, though, I will cut it 
  82. up after I'm done.
  83.  
  84. But there is one thing I need to mention... some of my functions use 
  85. other functions that only THEY use and are not needed to be accessed from 
  86. any where else.  Should I put them into the same O file?
  87.  
  88. How do I create an A or LIB file?  What is the difference between the 
  89. two?  I've never looked into this before.
  90.  
  91.  
  92.  
  93. About app-defs:
  94.  
  95. AVOID scancodes it the app-defs file.  It's easy enough to tell the 
  96. difference between Backspace and Ctrl-H (or Return/Enter/Ctrl-M, etc...) 
  97. regardless of where H is because while H may move, Backspace won't and 
  98. Ctrl-H is then just any key that produces an ascii code of 7 what ISN'T 
  99. the Backspace key.  It's quite simple.  Therefore, only specify ASCII 
  100. codes in the app-defs file for the letter keys.  Anything else like 
  101. Return, Enter, Backspace should, however, be referenced by scancode.  
  102. Plus, it's safe to do that because THEY don't move.
  103.  
  104.  
  105. Oh, and there's another problem with app-defs... if you don't have a TSR 
  106. to load it (of course translate it into something useful) and put it in 
  107. one place in memory, then you'll have every app with its own copy of the 
  108. file.  On the other hand, the TSR creates a load of its own problems, not 
  109. the least of which is the fact that the app is going to have to figure 
  110. out whether it should use the default key or determine if the user's put 
  111. one in there to customise it just for that app.
  112.  
  113.  
  114. ]Huh?   No, no, no.  Like this:
  115. ]
  116. ]*.*.autoSave.yes
  117. ]*.*.confirmAtExit.yes
  118. ]*.YourApp.autoSave.no
  119. ]*.TosWin.autoSave.no
  120. ]
  121. ]Get it?  Now everything but YourApp and TosWin will autosave.  Everything
  122. ]confirms at exit.  You can still manually save.  You don't have to change
  123. ]anything.  In fact, the file is pretty static.  You only need to change
  124. ]it to change global settings or to change a specific application to do
  125. ]something different than the global settings you've installed.  You edit
  126. ]less because if you turn off a global feature, that program you haven't
  127. ]used in 3 months doesn't have to be reconfigured!
  128.  
  129. I don't like this particular example.  There are some things that you 
  130. MIGHT want to configure in a global file, but auto-save isn't one of 
  131. them.  IF an app has auto-save, I would think that it should keep track 
  132. of it in its OWN config file.
  133.  
  134.  
  135. Everyone seems to be bent on making the app-defs file an ASCII file.  
  136. While I can see the clear benefits (user editable with an ASCII text 
  137. editor, etc.), I can see some clear draw-backs.  If it's an ASCII file, 
  138. any utility manipulating it will have to delete it and write a new one 
  139. any time a change is made because the size of the file would change 
  140. (although this isn't much of a big deal), plus it's harder to parce 
  141. (because if it's binary data, you don't have to parce at all!).
  142.  
  143.  
  144. Evan:
  145.  
  146. ]Thread2 - this waits on any number of file handles, although it only
  147. ]needs to wait on one (optional timeout).  It blocks until the
  148. ]device is has data ready to be read or written.  When Fselect returns,
  149. ]Fread as much data from the file handle (raw mode) as you can,
  150. ]with standard GEMDOS Fread() with a whatever maximum you like (you
  151. ]can use whatever you like, or dynamically change the size if Fread
  152. ]reads your entire buffer, then double the size so it doesn't fill
  153. ]up anymore!)  After you read all the data, update your windows
  154. ]internal and external structures.  Key events are still echoed
  155. ]directly to the modem, even during redraw.  Once you've done the
  156. ]update, call Fselect again and wait for more modem data.  This thread
  157. ]will block when there is no modem IO to read.
  158.  
  159. This sounds very interesting.  I'll have to figure out Fselect.
  160. One problem I have with modem I/O is that GEMDOS does not seem to provide 
  161. a way for me determine how many characters are there before using Fread.  
  162. As a result, I have to use Fread (or Bconin) repeatedly, reading one 
  163. character until Bconstat says there are no more characters.
  164.  
  165. I have a couple or routines that read directly from the Iorec